namespace Recast
{
	public unsafe partial class RecastGlobal
	{
		public unsafe partial class rcContext
		{
			public bool m_logEnabled;
			public bool m_timerEnabled;
			public rcContext(bool state = true)/*: m_logEnabled(state), m_timerEnabled(state)*/
			{
				m_logEnabled = state;
				m_timerEnabled = state;
			}
			~rcContext()
			{
			}
			public void enableLog(bool state)
			{
				m_logEnabled = state;
			}
			public void resetLog()
			{
				if (m_logEnabled) doResetLog();
			}
			public void log(rcLogCategory category, char* format, params object[] args)
			{
				if (!m_logEnabled)
				{
					return;
				}
				int MSG_SIZE = 512;
				char* msg = stackalloc char[MSG_SIZE];
				//va_list argList;
				//va_start(argList, format);
				//int len = vsnprintf(msg, MSG_SIZE, format, argList);
				//if (len >= MSG_SIZE)
				//{
				//    len = MSG_SIZE - 1;
				//    msg[MSG_SIZE - 1] = '\0';
				//    char* errorMessage = "Log message was truncated";
				//    doLog(RC_LOG_ERROR, errorMessage, (int)strlen(errorMessage));
				//}
				//va_end(argList);
				//doLog(category, msg, len);
			}
			public void enableTimer(bool state)
			{
				m_timerEnabled = state;
			}
			public void resetTimers()
			{
				if (m_timerEnabled) doResetTimers();
			}
			public void startTimer(rcTimerLabel label)
			{
				if (m_timerEnabled) doStartTimer(label);
			}
			public void stopTimer(rcTimerLabel label)
			{
				if (m_timerEnabled) doStopTimer(label);
			}
			public int getAccumulatedTime(rcTimerLabel label)
			{
				return m_timerEnabled ? doGetAccumulatedTime(label) : -1;
			}
			public void doResetLog()
			{
			}
			public void doLog(rcLogCategory category, char* msg, int len)
			{
				rcIgnoreUnused(category); rcIgnoreUnused(msg); rcIgnoreUnused(len);
			}
			public void doResetTimers()
			{
			}
			public void doStartTimer(rcTimerLabel label)
			{
				rcIgnoreUnused(label);
			}
			public void doStopTimer(rcTimerLabel label)
			{
				rcIgnoreUnused(label);
			}
			public int doGetAccumulatedTime(rcTimerLabel label)
			{
				rcIgnoreUnused(label); return -1;
			}
		}
	}
}
